package com.example.demo.controller;


import com.example.demo.entity.Abc;
import com.example.demo.service.ServiceAbc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/abc")
public class ControllerAbc {

    @Autowired
    private ServiceAbc serviceAbc;

    @PostMapping("/add")
    public String add(@RequestBody Abc abc) {
        boolean bb = serviceAbc.add(abc);
        if (bb == true) return "添加成功";
        return "添加失败";
    }

    @PostMapping("/dd")
    public String delet(Long id) {
        boolean cc = serviceAbc.delet(id);
        if (cc == true) return "删除成功";
        return "删除失败";
    }
}
